import { useAuthStore } from '@/store/auth';

export const permissionDirective = {
    mounted(el, binding) {
        const authStore = useAuthStore();
        const { value } = binding;

        if (!authStore.hasPermission(value)) {
            el.parentNode.removeChild(el);
        }
    },
};